(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0) → 0
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Rewrite Strategy: INNERMOST

(1) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(2) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

S is empty.
Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Innermost TRS:
Rules:
a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Types:
a__first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
0' :: 0':nil:s:cons:first:from
nil :: 0':nil:s:cons:first:from
s :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
cons :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
mark :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
a__from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
hole_0':nil:s:cons:first:from1_0 :: 0':nil:s:cons:first:from
gen_0':nil:s:cons:first:from2_0 :: Nat → 0':nil:s:cons:first:from

(5) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
mark, a__from

They will be analysed ascendingly in the following order:
mark = a__from

(6) Obligation:

Innermost TRS:
Rules:
a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Types:
a__first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
0' :: 0':nil:s:cons:first:from
nil :: 0':nil:s:cons:first:from
s :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
cons :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
mark :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
a__from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
hole_0':nil:s:cons:first:from1_0 :: 0':nil:s:cons:first:from
gen_0':nil:s:cons:first:from2_0 :: Nat → 0':nil:s:cons:first:from

Generator Equations:
gen_0':nil:s:cons:first:from2_0(0) ⇔ 0'
gen_0':nil:s:cons:first:from2_0(+(x, 1)) ⇔ s(gen_0':nil:s:cons:first:from2_0(x))

The following defined symbols remain to be analysed:
a__from, mark

They will be analysed ascendingly in the following order:
mark = a__from

(7) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol a__from.

(8) Obligation:

Innermost TRS:
Rules:
a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Types:
a__first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
0' :: 0':nil:s:cons:first:from
nil :: 0':nil:s:cons:first:from
s :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
cons :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
mark :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
a__from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
hole_0':nil:s:cons:first:from1_0 :: 0':nil:s:cons:first:from
gen_0':nil:s:cons:first:from2_0 :: Nat → 0':nil:s:cons:first:from

Generator Equations:
gen_0':nil:s:cons:first:from2_0(0) ⇔ 0'
gen_0':nil:s:cons:first:from2_0(+(x, 1)) ⇔ s(gen_0':nil:s:cons:first:from2_0(x))

The following defined symbols remain to be analysed:
mark

They will be analysed ascendingly in the following order:
mark = a__from

(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
mark(gen_0':nil:s:cons:first:from2_0(n12691_0)) → gen_0':nil:s:cons:first:from2_0(n12691_0), rt ∈ Ω(1 + n126910)

Induction Base:
mark(gen_0':nil:s:cons:first:from2_0(0)) →RΩ(1)
0'

Induction Step:
mark(gen_0':nil:s:cons:first:from2_0(+(n12691_0, 1))) →RΩ(1)
s(mark(gen_0':nil:s:cons:first:from2_0(n12691_0))) →IH
s(gen_0':nil:s:cons:first:from2_0(c12692_0))

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(10) Complex Obligation (BEST)

(11) Obligation:

Innermost TRS:
Rules:
a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Types:
a__first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
0' :: 0':nil:s:cons:first:from
nil :: 0':nil:s:cons:first:from
s :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
cons :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
mark :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
a__from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
hole_0':nil:s:cons:first:from1_0 :: 0':nil:s:cons:first:from
gen_0':nil:s:cons:first:from2_0 :: Nat → 0':nil:s:cons:first:from

Lemmas:
mark(gen_0':nil:s:cons:first:from2_0(n12691_0)) → gen_0':nil:s:cons:first:from2_0(n12691_0), rt ∈ Ω(1 + n126910)

Generator Equations:
gen_0':nil:s:cons:first:from2_0(0) ⇔ 0'
gen_0':nil:s:cons:first:from2_0(+(x, 1)) ⇔ s(gen_0':nil:s:cons:first:from2_0(x))

The following defined symbols remain to be analysed:
a__from

They will be analysed ascendingly in the following order:
mark = a__from

(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol a__from.

(13) Obligation:

Innermost TRS:
Rules:
a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Types:
a__first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
0' :: 0':nil:s:cons:first:from
nil :: 0':nil:s:cons:first:from
s :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
cons :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
mark :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
a__from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
hole_0':nil:s:cons:first:from1_0 :: 0':nil:s:cons:first:from
gen_0':nil:s:cons:first:from2_0 :: Nat → 0':nil:s:cons:first:from

Lemmas:
mark(gen_0':nil:s:cons:first:from2_0(n12691_0)) → gen_0':nil:s:cons:first:from2_0(n12691_0), rt ∈ Ω(1 + n126910)

Generator Equations:
gen_0':nil:s:cons:first:from2_0(0) ⇔ 0'
gen_0':nil:s:cons:first:from2_0(+(x, 1)) ⇔ s(gen_0':nil:s:cons:first:from2_0(x))

No more defined symbols left to analyse.

(14) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
mark(gen_0':nil:s:cons:first:from2_0(n12691_0)) → gen_0':nil:s:cons:first:from2_0(n12691_0), rt ∈ Ω(1 + n126910)

(15) BOUNDS(n^1, INF)

(16) Obligation:

Innermost TRS:
Rules:
a__first(0', X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
a__from(X) → cons(mark(X), from(s(X)))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(mark(X))
mark(0') → 0'
mark(nil) → nil
mark(s(X)) → s(mark(X))
mark(cons(X1, X2)) → cons(mark(X1), X2)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Types:
a__first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
0' :: 0':nil:s:cons:first:from
nil :: 0':nil:s:cons:first:from
s :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
cons :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
mark :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
first :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
a__from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
from :: 0':nil:s:cons:first:from → 0':nil:s:cons:first:from
hole_0':nil:s:cons:first:from1_0 :: 0':nil:s:cons:first:from
gen_0':nil:s:cons:first:from2_0 :: Nat → 0':nil:s:cons:first:from

Lemmas:
mark(gen_0':nil:s:cons:first:from2_0(n12691_0)) → gen_0':nil:s:cons:first:from2_0(n12691_0), rt ∈ Ω(1 + n126910)

Generator Equations:
gen_0':nil:s:cons:first:from2_0(0) ⇔ 0'
gen_0':nil:s:cons:first:from2_0(+(x, 1)) ⇔ s(gen_0':nil:s:cons:first:from2_0(x))

No more defined symbols left to analyse.

(17) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
mark(gen_0':nil:s:cons:first:from2_0(n12691_0)) → gen_0':nil:s:cons:first:from2_0(n12691_0), rt ∈ Ω(1 + n126910)

(18) BOUNDS(n^1, INF)